<div class="sortBar row">
	<?php if($showContact): ?>
		<div class="quickFind pull-right">
			<span class="quickTitle">
				<?php echo translate("gaseste_furnizori_repede"); ?></span> 
				<a href="#" title=""><?php echo translate("completeaza_o_cerere_de_oferta"); ?></a>
		</div>
	<?php endif; ?>
	
	<div class="productCounter pull-left"><?php echo $totalItems;?> <?php echo translate($totalItems == 1 ? "produs" : "produse"); ?></div>
	<div class="clearfix"></div>
	<div class="actionHolder">
		<div class="row">
			
			<?php if($showContact): ?>
				<div class="col-md-5 contact">
					<span><?php echo translate("selecteaza_si"); ?> </span> 
					<button class="btn btn-default companyContact"><?php echo translate("contacteaza_furnizori"); ?></button>
				</div>
			<?php endif; ?>
			
			<div class="viewTypeSelect col-md-4">
				<?php echo translate("mod_vizualizare"); ?>: 
				
				<a title="" class="detailedList <?php echo ($details == 1 ? "selected" : ""); ?>" id="singleColumn">&nbsp;</a>
				<a title="" class="list <?php echo ($details != 1 ? "selected" : ""); ?>" id="multipleColumns">&nbsp;</a>
			</div>
			
			
			<div class="pages col-md-3">
				<?php
					$totalPages = ceil(($products[0]["num_rows"]/$itemsPerPage));
					$currentPage = 1;
					if(getRequestParameter("p") && getRequestParameter("p") > 1)
					{
						$currentPage = getRequestParameter("p");
					}
					
					if($totalPages > 1)
					{
						echo translate("page"); ?>: <?php echo $currentPage."/".$totalPages;
						
						if($currentPage == 1)
						{
							$prevPage = false;
						}
						else
						{
							$prevPage = $currentPage - 1;
						}
						
						if($currentPage == $totalPages)
						{
							$nextPage = false;
						}
						else
						{
							$nextPage = $currentPage + 1;
						}
						
				?>
					<?php if($prevPage):?>
						<a href="<?php echo $page["url"];?>?p=<?php echo $prevPage; ?>" title="<?php echo translate("prev_page"); ?>" class="prev" page="<?php echo $prevPage; ?>"><span class="glyphicon glyphicon-chevron-left"></span> <?php echo translate("prev_page_short"); ?></a>
					<?php endif; ?>
					
					<?php if($nextPage):?>
						<a href="<?php echo $page["url"];?>?p=<?php echo $nextPage; ?>" title="<?php echo translate("next_page"); ?>" class="next" page="<?php echo $nextPage; ?>"><?php echo translate("next_page_short"); ?> <span class="glyphicon glyphicon-chevron-right"></span></a>
					<?php endif; ?>
				<?php
					}
				?>
			</div>
			<div class="clearfix"></div>
		</div>
	</div>
	<div class="sortOrder">
		<div class="text-right" id="sortHolder">
			<a href="#" title="" class="prevSort">
				<span class="glyphicon glyphicon-chevron-left"></span>
			</a>
			<a href="#" title="" class="nextSort">
				<span class="glyphicon glyphicon-chevron-right"></span>
			</a>
			<select id="sortBy" style="display:none;">
				<option value="id" selected="selected"><?php echo translate("sort_default"); ?></option>
				<option value="name"><?php echo translate("sort_name"); ?></option>
				<option value="price"><?php echo translate("sort_price"); ?></option>
				<option value="buy_count"><?php echo translate("sort_most_popular"); ?></option>
				<option value="view_count"><?php echo translate("sort_most_viewed"); ?></option>
			</select>
			<span class="textHolder"><?php echo strtolower(translate("sort_default")); ?></span>: 
			
			<a href="#" class="order desc">
				<?php echo translate("sort_order_desc");?>
				<span class="glyphicon glyphicon-sort-by-alphabet-alt"></span>
			</a>&nbsp;/&nbsp;
			<a href="#" title="" class="order asc selected">
				<?php echo translate("sort_order_asc");?>&nbsp;
				<span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
			<!--
		         price = translate("sort_price")
		         name = translate("sort_name")
		         buy_count = translate("sort_most_popular")
		         default = translate("sort_default")
			-->
		</div>
	</div>
</div>